package dd.prog2.exercises.set06;

public class Car {
	private int length;
	private int capacity;
	private int carNr;
	private Car next = null;
	static private int nr = 1;

	public Car(int length, int capacity) {
		this.carNr = nr++;
		this.length = length;
		this.capacity = capacity;
	}

	public int getLength() {
		return this.length;
	}

	public int getCapacity() {
		return this.capacity;
	}

	public int getCarNr(){
		return this.carNr;
	}

	public Car getNext() {
		return this.next;
	}

	public void setNext(Car c){
		this.next = c;
	}

	public void addCar(Car c) {
		this.next = c;
	}
}
